class AcceptedInvitationRequestsController < ApplicationController
	include InvitationRequestsAcceptanceHelper
	
	before_filter :authorize_admin

	def new
		get_invitation_request
	end

	def create
		get_invitation_request
		
		@invitation_request.change_status :accepted
		@invitation_request.person.participant = true
		
		InvitationRequest.transaction do
			@invitation_request.save!
			@invitation_request.person.save!
		end		

		Mailer.deliver_invitation_request_accepted(@invitation_request)
		
		# create participant
		
		redirect_to invitation_requests_path
	end
	
end
